package com.sharkburner.aeris.bean.article;

import java.util.Date;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

/**
 * Default Article bean
 * 
 * @author inartea
 *
 */
public class ArticleBean {
	
	private String name;
	private String descr;
	private String link;
	private String category;	
	private Date dateCreation;
	private Image image;	
	
	@XmlElement(name="title")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@XmlElement(name="description")
	public String getDescr() {
		return descr;
	}

	public void setDescr(String descr) {
		this.descr = descr;
	}

	@XmlElement(name="link")
	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	@XmlElement(name="pubDate")
	@XmlJavaTypeAdapter(RssDateFormat.class) 
	public Date getDateCreation() {
		return dateCreation;
	}

	public void setDateCreation(Date dateCreation) {
		this.dateCreation = dateCreation;
	}
	
	@XmlElement(name="category")
	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	@XmlElement(name="image")
	public Image getImage() {
		return image;
	}

	public void setImage(Image image) {
		this.image = image;
	}
	
	public static class Image{
		
		private String url;

		public void setUrl(String url) {
			this.url = url;
		}

		@XmlElement
		public String getUrl() {
			return url;
		}
	}
}
